home *** CD-ROM | disk | FTP | other *** search
- Path: peer-news.britain.eu.net!uknet!str-ccsun!not-for-mail
- From: nbc@vulture.dmem.strath.ac.uk (Neil Brendan Clark)
- Newsgroups: comp.sys.amiga.misc
- Subject: Re: Acorn RiscPC --- a thought?
- Date: 12 Feb 1996 19:08:49 -0000
- Organization: University of Strathclyde
- Message-ID: <4fo381$c0t@vulture.dmem.strath.ac.uk>
- References: <1996Feb5.164323.465@rmcs.cranfield.ac.uk> <1996Feb8.124744.14853@leeds.ac.uk> <4fdglm$b8s@vulture.dmem.strath.ac.uk> <1996Feb12.152844.28437@leeds.ac.uk>
- NNTP-Posting-Host: vulture.dmem.strath.ac.uk
-
- J M Oldak <csxjmo@scs.leeds.ac.uk> wrote:
- >Neil Brendan Clark writes:
- >
- >On the plus side - Co-operative multitasking means that the programmer has to
- >be aware of the efficiency of the program.
-
- This is a plus point? With a proper MT system, the programmer does not have
- to be aware that he is sharing the CPU with any other processes, at least
- in a simple sense. The *one* benefit I can think of concerning coop MT
- is that concurrency control becomes easier in some situations - effectively
- because there is none ;-)
-
- >This means that the program can use little or no processor time if it
- >isn't doing much. For example, a desktop clock only has to bother the
- >OS every second, the rest of the time it can use no time at all.
-
- This is not a feature unique to co-op MT! Do you really think that on
- proper MT systems *every* task is busy waiting? On my UNIX box at work,
- there are currently 67 processes. If what you state was the case, the
- machine would be utterly swamped. No, within all proper MT systems, there
- are various methods for setting up timing and so on. In the case of your
- desktop clock, a simple way would be to use UNIX sleep() or AmigaDOS Delay().
- These calls simply place the task onto another queue of "sleeping" processes,
- whereas the ones wanting to run are placed on a "runnable" queue, until
- their time is up. More sophisticated mechanisms also exist, such as the
- UNIX alarm() call. Of course, there is a small overhead to pay for this,
- but it is *very very* small.
-
- >Furthermore, there are times when single tasking something is
- >an advantage. If you are, say, viewing an MPEG (possibly a bad example...),
- >why not let the thing single task?
-
- Again, this can be arranged. If you set the MPEG task to a high priority,
- it will get all the CPU time it needs at the expense of other tasks, giving
- the effect (more or less) of single tasking. You have the choice!
-
- >There are times when you want as fast a
- >response as possible...
-
- Again, set up your process to have a high priority and your wish comes true.
- In fact, I have generally found cooperative MT systems to have dismal
- interactive response times; you in fact cannot guarantee a fast response
- at all.
-
- >No, it just let's all tasks that want processor time have it. Win 3.1 (and Win
- >95 with old apps) does not.
-
- It must have some CPU arbitration mechanisms then?
-
- >gee, thanks!
-
- Oh, that's OK! ;-)
-
- >During that 0.8 seconds - does the machine multitask?
-
- Yes.
-
- >If so - why?
-
- Many reasons. The machine is networked, so certain housekeeping tasks must
- go on in the background. The machine is also an NFS server and the host for
- an X Terminal in the lab (i.e. it runs processes which are displayed on another
- machine, like a GUI terminal). There is a dumb terminal also dangling off it,
- and there may well be other users logged on from various sites around the
- campus. In addition to this, I am running an http daemon, and sendmail also
- kicks about strutting its funky stuff now and then. It wouldn't do for
- everything to stop when I was decompressing a JPEG!
-
- Another good reason is that I had to convert many tiff files to JPEGs recently;
- a small shell script running at low priority in the background while I did
- other things was a most useful solution - why lock the machine up?????
-
- >You could be using them all!
-
- OK, in theory you could, but in reality it is still not heavily loading
- the machine - you are still doing things interactively.
-
- >You could be copying/compressing files etc in the command shell,
-
- Disk I/O is slow, leaving spare CPU cycles.
-
- >while doing a drag & drop OLE from your Vector drawing (or JPEG decompressor)
- >into the DTP program...
-
- Again this is pretty interactive, and the CPU will be idle for most of the time.
-
- >|> Hopefully with proper multitasking. I think part of the problem with people
- >|> who claim that you don't need pre-emptive MT is that they have never really
- >|> used it before. Once you have used such a system, there is no going back.
- >
- >Untrue!
- >
- >I use SGI's in the university with X windows. They have more power than my Risc
- >PC, but in general use they run slower, because background tasks are taking
- >time from my foreground ones.
-
- Rubbish. You are comparing apples and oranges here. *If* there are background
- tasks running (presumably created by other people?) then they will have to
- busy wait to eat CPU time. If they are interactive backgroud processes, they
- will use very little CPU. You will have to try very hard to see any difference
- in this case. If people are ruuning CPU intensive tasks in the background,
- they really should "nice" them to give interactive users more CPU time. It
- is possible to set up the system to do this automatically. In any case,
- a busy tasks priority decays with time, whereas a task that voluntarily gives
- up the CPU instead of having to be repeatedly forced off it retains a high
- priority. You seem to have the notion that every task eats CPU all the
- time; this is not the case. In fact, most tasks are idle most of the time.
- To illustrate, here is some output from my UNIX box;
-
- USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
- nbc 12301 0.0 1.6 456 220 p2 R+ 7:03PM 0:00.01 ps -ux
- nbc 12103 0.0 3.7 376 528 ?? S 6:02PM 0:05.00 fvwm -s
- nbc 12114 0.0 0.2 568 28 p3 Is 6:02PM 0:00.36 -csh (tcsh)
- nbc 12115 0.0 3.9 572 552 p2 Ss 6:02PM 0:00.51 -csh (tcsh)
- nbc 12130 0.0 0.7 2572 88 p3 I+ 6:02PM 0:04.15 trn
- nbc 12168 0.0 1.5 260 204 ?? I 6:05PM 0:00.28 /usr/X11R6/lib
- nbc 12169 0.0 0.0 464 0 ?? IW 6:05PM 0:00.02 /bin/sh -c xcl
- nbc 12170 0.0 1.9 252 264 ?? I 6:05PM 0:00.21 xclock -bg #90
-
- Note the %CPU column?
-
- >Admittedly, ithas to be pre-emptive for it to be
- >a multi-access system, but I'm talking about what it's like sitting at one,
- >disregarding other people...
-
- Perhaps you just have a heavily loaded system?
-
- --
- "I have trouble imagining death at that income level" - White Noise, D.Delillo
-
- Neil Clark, Transparent Telepresence Group
- http://telepresence.dmem.strath.ac.uk
-